﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Web.Management;

namespace OpenLightGroup.Common.ApplicationServices
{

    public class ClientDebugEvent : WebBaseEvent
    {
        internal ClientDebugEvent(string message, object eventSource, int eventCode, int eventDetailCode, EventLogRequest request)
            : base(message, eventSource, eventCode, eventDetailCode)
        {
            this.EventLogRequest = request ;
        }

        protected internal ClientDebugEvent(string message, object eventSource, int eventCode)
            : base(message, eventSource, eventCode)
        {
            
        }
        protected internal ClientDebugEvent(string message, object eventSource, int eventCode, int eventDetailCode)
            : base(message, eventSource, eventCode, eventDetailCode)
        {

        }

        public EventLogRequest EventLogRequest { get ; set ;  }

        public override void FormatCustomEventDetails(WebEventFormatter formatter)
        {
            base.FormatCustomEventDetails(formatter);

            formatter.AppendLine("Client Event Details:");

            formatter.AppendLine(this.EventLogRequest.ClientDetails);
        }
    }

}
